#include <Arduino.h>

// put function declarations here:
int led_pin = 3;
int tilt_pin = 0;

void setup()
{
  // put your setup code here, to run once:
  pinMode(led_pin, OUTPUT);
  Serial.begin(9600);
}

void loop()
{
  // put your main code here, to run repeatedly:
  int tilt_val = analogRead(tilt_pin);
  Serial.print("tilt:");
  Serial.println(tilt_val);
  int led_val = map(tilt_val, 30, 1024, 0, 255);
  analogWrite(led_pin, led_val);
}

// put function definitions here: